<?php
class Fapiao_invoice_model extends CI_Model
{
    private $table = 'fapiao_invoice';
    
    public function insertFapiaoInvoice($postData)
    {
        $data = $postData;
        $this->db->insert($this->table, $data);
        $insert_id = $this->db->insert_id();
        if ($insert_id) {
            return $insert_id;
        }
        return false;
    }
    
    public function getFapiaoByOrderId($order_id)
    {
        $this->db->where('order_id', $order_id);
        return $this->db->get($this->table);
    }
}